﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkillifyMaster.master" AutoEventWireup="true" CodeFile="ManageQuestionBank.aspx.cs" Inherits="ManageQuestionBank" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
        }
        .style3
        
        {
        }
        .style4
        {
            width: 279px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style1">
        <tr>
            <td class="style2" colspan="3" align="right">
                 <h2><asp:Label ID="lablManageQues" runat="server" Text="Manage Question Bank"></asp:Label></h2>
            </td>

        </tr>
        <tr>
            <td colspan="3">
                <table align="left" cellspacing="2" style="border: 4px outset orange;" width="100%">
                    <tr>
                        <td>
                                <asp:Label ID="lablSubj" runat="server" Text="Subject"></asp:Label> &nbsp;&nbsp;
                                 <asp:DropDownList ID="ddlSubject" runat="server" AutoPostBack="True" 
                                    Width="220px" OnSelectedIndexChanged="ddlSubject_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="lablTopics" runat="server" Text="Topic"></asp:Label>&nbsp;&nbsp;
                                <asp:DropDownList ID="ddlTopics" runat="server" Width="220px" 
                                    onselectedindexchanged="ddlTopics_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="btnShow" runat="server" Text="Show Question" 
                                onclick="btnShow_Click" CausesValidation="False" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="btnClearSearch" runat="server" Text="Clear Search" 
                                 CausesValidation="False" BackColor="#E49642" 
                                BorderColor="#CC7A24" onclick="btnClearSearch_Click" ForeColor="White" />

                        </td>
          .           </tr>
                </table>
            </td>

        </tr>
        <tr>
            <td class="style3" colspan="2">
                <table align="center" width="100%">
                    <tr>
                        <td align="center" valign="top">
                            <b><asp:Label ID="lablAvailQues" runat="server" Text="Available Questions" 
                                Visible="False"></asp:Label></b>
                        </td>
                    </tr>

                    <tr>
                        <td align="left" valign="top">
                           <asp:GridView ID="gvQuestion" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" DataKeyNames="QuestionId" 
                        onselectedindexchanged="gvQuestion_SelectedIndexChanged" 
                        onpageindexchanging="gvQuestion_PageIndexChanging"
                        BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
            CellPadding="2" ForeColor="Black" GridLines="Vertical" Width="930px">
             <AlternatingRowStyle BackColor="PaleGoldenrod" />           
                        <Columns>
                            <asp:ButtonField ButtonType="Link" CommandName="Select" 
                                DataTextField="QuestionId" HeaderText="QId" SortExpression="QuestionId"  
                                ItemStyle-Font-Underline="true">
<ItemStyle Font-Underline="True"></ItemStyle>
                            </asp:ButtonField>
                            <asp:BoundField DataField="SubjectName" HeaderText="SubjectName" 
                                SortExpression="SubjectName" />
                            <asp:BoundField DataField="TopicName" HeaderText="TopicName" 
                                SortExpression="TopicName" />
                            <asp:BoundField DataField="Question" HeaderText="Question" 
                                SortExpression="Question" />
                            <asp:BoundField DataField="Answer" HeaderText="Answer" 
                                SortExpression="Answer" />
                            <asp:BoundField DataField="Justification" HeaderText="Justification" 
                                SortExpression="Justification" />
                            <asp:BoundField DataField="Priority" HeaderText="Priority" 
                                SortExpression="Priority" />
                            <asp:BoundField DataField="IsMul" HeaderText="IsMultiple" 
                                SortExpression="IsMultiple" />
                            <asp:BoundField DataField="IsAct" HeaderText="IsActive" 
                                SortExpression="IsMultiple" />
                        </Columns>
                         <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
         <FooterStyle BackColor="Tan" />
            <HeaderStyle BackColor="#CB6811" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedRowStyle BackColor="#E49642" ForeColor="GhostWhite" />
            <SortedAscendingCellStyle BackColor="#FAFAE7" />
            <SortedAscendingHeaderStyle BackColor="#DAC09E" />
            <SortedDescendingCellStyle BackColor="#E1DB9C" />
            <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                    </asp:GridView> 
                        </td>
                    </tr>
                </table>
            </td>

            <td>
            </td>
        </tr>
        <tr>
          <%--  <td class="style4">
                &nbsp;</td>--%>

            <td width="100%">
                <table align="left" cellspacing="2" style="border: 4px outset orange;" width="100%">
                    <tr>
                        <td colspan="3" align="center">
                           <b><asp:Label ID="lablMess" runat="server" Text="Add/Edit Question Information"></asp:Label></b>
                        </td>
                    </tr> 

                    <tr>
                    <td>
                        <!-- Table to for Input -->
                        <table width="100%" cellspacing="3">
                         <!-- Select Subject -->
                         <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablSub" runat="server" Text="Subject"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:DropDownList ID="ddlSub" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="ddlSub_SelectedIndexChanged" Width="260px">
                                        </asp:DropDownList>
                                    <asp:CompareValidator ID="CompSubVal" runat="server" 
                                        ControlToValidate="ddlSub" ErrorMessage="Must Select one Subject" 
                                        ForeColor="Red" Operator="NotEqual" ValueToCompare="--Select One--">*</asp:CompareValidator>
                                </td>                               
                            </tr>
                            <!-- Select Topic -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablTopic" runat="server" Text="Topic"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:DropDownList ID="ddlTopic" runat="server" Width="260px">
                                        </asp:DropDownList>
                                </td>                               
                            </tr>
                            <!-- New Topic -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="Label1" runat="server" Text="If Topic is not Availbale, enter new one here"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:TextBox ID="txtAddTopic" runat="server" Enabled="False" 
                                        AutoPostBack="True" Width="182px" ></asp:TextBox>
                                    &nbsp;
                                    <asp:Button ID="btnAddTopic" runat="server" CausesValidation="False" 
                                        onclick="btnAdd_Click" Text="Add" Width="71px" BackColor="#E49642" 
                                        BorderColor="#CC7424" ForeColor="White" />
                                </td>                               
                            </tr>
                            <!-- Question -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablQues" runat="server" Text="Question"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:TextBox ID="txtQuestion" runat="server" Height="85px" TextMode="MultiLine" 
                                        Width="600px"></asp:TextBox> &nbsp;
                                    <asp:RequiredFieldValidator ID="ReqValTopic" runat="server" 
                                        ControlToValidate="txtQuestion" ErrorMessage="Please Give a Question" 
                                        ForeColor="Red">*</asp:RequiredFieldValidator>
                                </td>                               
                            </tr>
                            <!-- Options Added -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablOption" runat="server" Text="Options"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:ListBox ID="lblOptions" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="lblOptions_SelectedIndexChanged" Width="600px" 
                                        Height="116px"></asp:ListBox>
                                </td>                               
                            </tr>
                            <!--New Option -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="Label2" runat="server" Text="Enter Options for Questions one by one here"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                   <asp:TextBox ID="txtAddEditOptions" runat="server" Width="525px"></asp:TextBox>
                                        &nbsp;<asp:Button ID="btnAddEditOption" runat="server" CausesValidation="False" 
                                        onclick="btnAddEdit_Click" Text="Add" Width="71px" BackColor="#E49642" 
                                        BorderColor="#CC7424" ForeColor="White" />
                                </td>                               
                            </tr>
                            <!--Multiple Options -->
                            <tr>
                                <td align="right" width="20%">
                                    
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                   <asp:CheckBox ID="chkEnableMul" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkEnableMul_CheckedChanged" 
                                        Text=" Enable Multiple Options" />
                                </td>                               
                            </tr>
                            <!-- Answers -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablAnswer" runat="server" Text="Answers"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                   <asp:RadioButtonList ID="rdoOptionList" runat="server" 
                                        RepeatDirection="Horizontal"></asp:RadioButtonList>
                                   <br />
                                    <asp:CheckBoxList ID="chkOptionList" runat="server" Visible="False" 
                                        RepeatDirection="Horizontal"></asp:CheckBoxList>
                                </td>                               
                            </tr>
                            <!-- Justification -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="Label3" runat="server" Text="Justification"></asp:Label></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                   <asp:TextBox ID="txtJustification" runat="server" TextMode="MultiLine" 
                                        Height="116px" Width="600px"></asp:TextBox>
                                </td>                               
                            </tr>
                            <!-- Priority -->
                            <tr>
                                <td align="right" width="20%">
                                    <b><asp:Label ID="lablPriority" runat="server" Text="Priority" /></b>
                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:DropDownList ID="ddlPriority" runat="server" Width="90px">
                                        <asp:ListItem Selected="True">Low</asp:ListItem>
                                        <asp:ListItem>Medium</asp:ListItem>
                                        <asp:ListItem>High</asp:ListItem>
                                    </asp:DropDownList>
                                </td>                               
                            </tr>
                            <!-- Active -->
                            <tr>
                                <td align="right" width="20%">

                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <b><asp:CheckBox ID="chkIsActive" runat="server" Text=" IsActive" 
                                        Checked="True" /></b>
                                </td>                               
                            </tr>
                            <!-- Buttons -->
                            <tr>
                                <td align="right" width="20%">

                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
                                        Text="Submit" Width="71px" BackColor="#E49642" BorderColor="#CC7424" 
                                        ForeColor="White" />
                                        &nbsp;&nbsp;&nbsp;
                                    <asp:Button ID="btnClear" runat="server" CausesValidation="False" 
                                        onclick="btnClear_Click" Text="Clear" Width="71px" BackColor="#E49642" 
                                        BorderColor="#CC7424" ForeColor="White" />
                                </td>                               
                            </tr>
                            <!-- Summary -->
                            <tr>
                                <td align="right" width="20%">

                                </td> 
                                <td>
                                    &nbsp;&nbsp;
                                    <asp:ValidationSummary ID="ValidationMessage" runat="server" ForeColor="Red" />
                                    <br />
                                    <b><asp:Label ID="lablError" runat="server" ForeColor="Red"></asp:Label></b>
                                </td>                               
                            </tr>
                        </table>
                    </td>
                    </tr>

                 </table>
            </td>

            <td>
            </td>
        </tr>
        <tr>
            <td class="style4">
                &nbsp;</td>

            <td>
            </td>

            <td>
            </td>
        </tr>
    </table>
    </table>
    </table>
</asp:Content>

